$(function() {
	var oldcontent = '';
	/** Track Submit */
	$("#notes").blur(function(event) 
	{
		var $contactData = $("#contact-data");
		var rid = $contactData.data('id');
		var notid = $contactData.data('notid');

		// Serialize content
		var data = $(this).serialize();
		var old = $(this).data('old');
		if(data != old) {
			$.post('?mod=ressource&act=notes&xvtrs=none&rid='+rid+'&notid='+notid,data, function(data) {
				try {
					var data = JSON.parse(data);
				} catch(e) {
					
				}
				$.fn.foxmessage(data);
			});
		}
		return false;
	});
	$("#notes").focus(function(event) {
		var data = $(this).serialize();
		$(this).data('old',data);
	});
});